/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package collections;

import model.entitys.Named;
import model.entitys.NamedEntity;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.*;

/**
 *
 * @author Slayer
 */
public class NamedTest {
    private Named named;
    private NamedEntity<String> namedEntity;
    
    private final String NAMED_STRING = "Named";
    private final String NAMED_ENTITY_STRING = "NamedEntity";
    
    public NamedTest() {
    }
    
    @Before
    public void setUp() {
        named = new Named(NAMED_STRING);
        namedEntity = new NamedEntity<String>(NAMED_ENTITY_STRING);
    }
    
    @After
    public void tearDown() {
    }
    
    @Test
    public void shouldReturnInitialNameWhenGetNameNamed(){
        //given
        String expected = NAMED_STRING;
        //then
        assertEquals(expected, named.getName());
    }
    
    @Test
    public void shouldChangeNameWhenSetNameNamed(){
        //given
        String expected = "String";
        //when
        named.setName(expected);
        //then
        assertEquals(expected, named.getName());
    }
    
    @Test
    public void shouldReturnInitialNameWhenGetNameNamedEntity(){
        //given
        String expected = NAMED_ENTITY_STRING;
        //then
        assertEquals(expected, namedEntity.getName());
    }
    
    @Test
    public void shouldChangeNameWhenSetNameNamedEntity(){
        //given
        String expected = "String";
        //when
        namedEntity.setName(expected);
        //then
        assertEquals(expected, namedEntity.getName());
    }
}
